Added query to Logout that checks for users who aren't logged in.