updated error detection and display