cleanup promise handling