fixing up some stuff when outputting the items