bug fix and deprectation warning added to cross-validation