Add callback to search function