fixed potential crash and candel in inventory