fixed error on material creation