test if a task is null before add to the queue