fixed issue with duplicate materials being created