fix crash on private inventories
fix indentation