fixes #4619 change how we determine row count