change: would be better to use memory buffer.