Adding buffer close