defined update function for users model