shitty code for events