Corrected UART code