fixed to adjust buffer size to be dynamically assigned if large messages are detected
adjusted debug, warning and error messages