Saving messages in db