correctly handle pagebreaks