Fixed the search persist logic.