dispatchEvent bug fixed.