fix a bug when readline from uart