dispatch events, examples of how to use