fix the optimizationzation