fix nested message handling