updated sidebar code