Putted the function that detected the class of the elements in the side bar inside the sidebar controller.