Added pending messages saving