modified ec2dhcp to only execute on some events