fix file open method