fix file handle bug
Merge pull request #273 from teharrison/master

fix file handle bug