added stop() function