fix bug in task queue operation