Use findIndex for find material type