added jquery logic that HOPEFULLY prevents memory leaks when reseting views.