else:
if instanceState == 'running':
handleEvent(message, event, ASGName, InstanceId)
else:
logging.debug('instance %s is in state %s, will try again', InstanceId, instanceState)
else:
if instanceState == 'running':
handleEvent(message, event, ASGName, InstanceId)
else:
logging.debug('instance %s is in state %s, will try again', InstanceId, instanceState)