Fix login error

see #127 and #138