fixed the issue with reading files with fseek()