use custom event instead of baking into the DOM directly