Implement script stop life cycle