issue #3251 fix bug for layout