Bug fix for paginating.