issue #5183, fix Layout visit issue