fixes open file problem