removed unecessary console.dir and reinstated error handling for the new updateUser function