fixed possible nullpointer in stop function and added complete callback for stopping the instance