Fixes the double-firing

Changed the onclick to take the event as a parameter (`e` by convention).

Then you just have to call `e.stopPropagation()` to prevent the event from bubbling up and firing twice.