fix wrong function name used in optimizing