use safebuffer