counting remaining task by checking all the task states instead of relying on previous remainTasks value
Merge pull request #302 from wtangiit/master

counting remaining task by checking all the task states