fixed openfile issue