fix bug in loading file