added error tolerance feature