Revert "modify checking number of tasks"

This reverts commit 4572dcabc4c0cab7445c29bdf928e2bd78baced1.
modify checking number of tasks(again)