getCount function added