fix file open bug