fixed issue with some material names not being unique