close file before delete
Merge pull request #255 from pijyoi/master

close file before delete