fix immediate optimization