Added a stop() function