fix broken search function