improved checking for password, fixed typo