changed buffer handling