Changed log(msg) to console.log(msg) as log(msg) was causing error in Firefox 36, the latest version now