adds custom event code