fixed some minor bugs.
problem where email is passed as valid when it is invalid.