fix for optimization script