Fix the bug where the pagination wouldn't disappear.