make h5_funcs more robust