Updated code to update user profile.