add after_success and after_failure