Finish to insert message to database