Remove unused code that triggered a javascript error