layout logic change