cleanup promise chain and message handling