fixed buffer resizing
fixed usage bug