defined update function of users model