Fix pending message appearance when switching pages