Added rebuilding of task tree when new task arrived