sync writing hook