added ub_buffer_writer functions