fixed wrong error rate calculation