fix overflow on file offset