Tweaked auto event code