fixed bug: pickled file left open