preventing routepreview from doing stuff when it's not in the layout