fix buffer overflow.