fix to js to apply to the event to the global document object - it wasn't triggering