Add code to fix the layout display bug.