fix a bug with the logged-in? function