Added testError function