changed the way to render layouts