modified getQueue to check if queue exists and modified method signature