search function completed