fixed bug in queue