avoid queue.peek() is null in CancelJob