fix calling function
stringify msg
stringify envelope