fixed crash in inventory