fixed file position bug