fixed hdf5 write