fixed bug with duplicate tasks in queue