close file after temp file creation. Fixes #1.
release 0.3.1 - bug fixes
Fixes #1