update sidebar logic