replaced fsync on fd with a flush on the channel...