Trying to fix the crashes due to inventory