cleanup buffer