Fix bug in case of executing resume with remain some tasks