edit materials bug fix