recycle and fix nodesOfStack bug