fix error when slicing pages