added flags to check if user is logged in