fixed error calculation bug for multi class