buffer: add checking for other write function