fixing broken javascript

Quick fix for some broken javascript.