search finally working properly