workaround, replace getc with read read from uart.