upgraded checkPassword