added checks for not logged in users and empty queues