change warning function to wrap console.log in try/catch to avoid IE 9 woes