Added arrayoutofbounds error check when loading npc's