moves rendering to before routing in app so that we can render layouts before trying to route