fix up the right-rail directive to work with multiple tabs