Issue #168 - fix bug in login