fixed #1 misuse of the fseek func