Fixed read only buffer error.