Fixing login/logout