bugfix: made sure count_on_hand_was is defined