bugfix for listing items, using while loop instead of range