updated cross validation with grid based search