search function actually working