Properly close file
Merge pull request #9 from viniciusnz/master

Properly close file