optimizations fix