fix state encoding in login.R - closes #515