Better way of handling the buffer overflow error.