adding fix for exception thrown when y does not have all classes