Imporoved error detection