fixed buffer limit handling