found a bug where the HDFStore doesn't get closed after the function is called