Fix double render when a new template is rendered

This fixes the double render issue we are getting. This is very
noticeable on a first render. The fix is to wait for the layout to
rendered and then only render the views.