moved structure back for msg variable