Fixed hasPassword code