Renamed sync to flush