fixing item count variable