modified register new user with more error handling, and more fields.