Check for nil before inserting message in dictionary