fixed the sidebar; added add class function