Fix bug in sidebar menu code