fix EOR handling