implemented stop functionality