Use .sync instead of .flush