added validation for user input, and adds user to database once validated.