fixed the JS for sidebars