adding newClass dependency in method call