problems with buffer being cut short