fix exception
Merge pull request #4 from sheavner/master

fix exception while saving file.