added error measurement