fix bugs of the layout