javascript fix for mirror.js