minimization bug fixed