fixed bug on opening file