added some cleanup. pending message wrong