fix bug when parsing npc data