improve sidebar function to include no sidebars