Adding stop function in public api.