better buffer write support