mostly fix search mechanism