JR1040 script fix