added an update function for user in server