Added a check for existence of a password and a corresponding error message.