implemented login form validation