Fixed bug with queue