debugging search function