count function type correction