filter search retain and rest fixes
final fix and cleanups