better handling of stop
added reference