Count should be outside for loop