fix bug with open file