figured out how to pass layers back to managed code