add class exists check to pass the controller tests.