fix broken code to make main search page work