fixing bad material references