Updated message checking to avoid stale data from being displayed.