add search state helper
end search before refresh