fix error when loading file