fixing stop functionality