add missing flush in hdf write process