legacy count fix and var name change