added npc base logic