Improved IE8 compat

Prevent IE8 from throwing "Object doesn't support this property or method" error