Improve erreur detection