About your Sidebar code, take a look at my post here
this will give you a better solution than having to add code, IMHO.