fix a bug: open file when ST is clsoed