made reset_buffer working