Fixed the empty inventory crash