I think it makes more sense to figure out why the callback isn't defined and fix it. What version of the search package are you using?