fixed the bug in my bagging