ex17: add a connection pointer to the die function