updateData function

Updating data in a model