Added ugly hack for browser without onbeforeexecute handler