fix when redirect to file task will not flush error