slight improvement to password handling