undo stupid mistake

maybe.... need to look at inventories and see if that makes sense
make it work when tables unpopulated
adding error log