minor bugfix for stop function