fixed a bug that was deleting the messages