Fix check regarding whether the file is opened