trying to write from buffer