Added more error handling for user register