run sync() at the end