Fixed bug when updating user profile