fixing error that breaks optimizations other than pk