correctly load dependencies for material and handle errors