adding error handling for login page