:gb: Implemented dispatchEvent function