add bagging support