Fixed logged in detection