get_buf_by_name function