buffer overrun fix