updated after_failure script