fixed search handler bug and implementing filtering