bagging fix