adding ajax validation for registration and alert if login failed