add preparemessage method