Fix search pagination bug