hacky solution to my the event handling problem