fixes the offending js code