fix a bug that new file created every time