changed expandSidebar func