minor fix to check if user is logged in or not