fix the bug in layout