fixed XP array out of bounds error