fixed some errors in cross validation