Fix page refresh bug when searching.