Merge pull request #273 from teharrison/master

fix file handle bug