fixing forward references for classes