fixed bug in stop() function, that made stop() failure.