Fix toString check on internet explorer

- cannot use window.toString, better use object.toString:
-
http://stackoverflow.com/questions/19321938/invalid-calling-object-error
-in-ie