buffer resizing fixes

buffer resizes now properly