Properly check for logged-in status