functionality for sidebar