added buffer disposing