dom and javascript fixes