fix error on home page and layout page