adding a way to ensure that a daemon is stopped