Fixed an file open problem