add the flush function and change the some synchtask