adding checks around counts