make insertMessage work