improvement fireEventWithJS