Fixed code by providing file handle
Merge pull request #2 from svisser/patch-1

Fixed code by providing file handle