Added materialManager function.