fixed page count issue with sed