Fixed a bug due to size of write buffer