changed fseek to lseek