Fix issue with badge counter update and delete messages with references