better shutdown protocol on changes