script optimization now triggers script generation