fix count (could be undefined)