fixed null item bug in ItemFactory