Fixed bug with IE11

IE11 does not correctly  execute the dispatchEvent on a div. It shows an error:

Object doesn't support this action.

The pull request prevents that by enclosing the call in a try catch