fixing a bug because callbacks get called twice when there is a last labeled planned task