added debugging for agent status change