improved sidebar, fixed bugs