This is the meat of the change. Don't continue sending the message when the device is invalid or inactive.