Fix _write callback