Javascript fixes

javascript fixes