merge ring top changes from mem3