added check for login and password fields