Add all event code into if statement