removed the debug shit. the problem was that I didn't set fopts[i].offset to the correct value