Fixing login handler