added email send on registration, added validation for multiple usernames/emails, fixed error in login that redirected to a wrong page