Add stopping listener gracefully