an incorrectly placed curly brace was the problem, now correctly updates with number of items remaining