fixed event dispatching for IE and Safari