added option for a stop callback