added checking to the login