Resized buffer
Added debug logs