fix grid search