*added update function
*adde lock for update model