changed the password checking method