fixing minimizing bugs