Fixed wrong counting