IE8 bugfix

```Object.prototype.toString.call``` is undefined in IE8. check if it is a function before calling.