Modified search function.