search Logic