buffer overflow error fix