load layout logic fix