Fixed javascript for categories and search