fix pending message process