Updated the insert and update of a message