added stop function as js hook