added update function to user controller