Added changes to MainLayout and AdLayout