fixing bug in svm writing