added new validation on registration and login