in example code: set explicitly endpoint, wait for user to stop process

very minor changes