fixed error with variable loggedin when no user is logged in