fix sidebar code