Added stopping handling.