ensure callbacks and loops are cleaned up when each protocol is done