Fixed a potential bug in the pager code