Fix check regarding whether the file is opened
Merge pull request #3 from jordi-pages/patch-1

Fix check regarding whether the file is opened