fixed bug with queue