UART improved, waiting for end of transmision and reception of data added