fixed typo. added all stop code to terminate callback