Missing entities count function added