IE8 fix

Fixes Issue #13:

returns the following error on IE8:

Line: 843
Error: Object doesn't support this property or method