Fix bug: check task is running was not worked as expected.