Update script js to th

ann fix bug material