fix file position bug