corrected var used for count output