reverts #6, as can raise exceptions incorrectly on large files