throw exception if class does not exist.