issue #4221 fixed a bug for layout