fixed custom event code