Update for dynamic sidebar function