successfulcount should be done at end, only