Fixed buffer size issue