fix issue with getCount function