Added authentication and checking of both passwords and emails