fix bad optimization