adding our custom patch for smart_paging