Fix pending message caching