fix bug: duplicated tasks if foreman check before its finished part 3