Add counter for pending tasks to sensors. Wait until all tasks are finished before deconstructing anything