added data validation, user login, email sending