changed to Marshal to make sure that the data is marshalled when the function runs