add a method to check password is set.