Added another condition to count to ensure wigo ids equal.