Add the sidebar change function