fix search stuff, un-nest callbacks etc