Added better error handling to the user creation