fix bug on rowSum in globalCounter