add memory stage