change stop function and test case.