PlayerPrefsX IntArray

I keep getting the error of index out of range exception for PlayerPrefsX Int Array. I want to replace the highscore whenever score is higher. Here are my codes:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class ScoreManager : MonoBehaviour 
{
	public static int score;
	public static int[] highScores = new int[2];
	public Text scoreText;
	public Text highScoreText;

	void Awake ()
	{
		score = 0;
		if (PlayerPrefs.HasKey ("HighScore"))
		    highScores = PlayerPrefsX.GetIntArray ("HighScore");
		PlayerPrefsX.SetIntArray ("HighScore", highScores);
	}

	void Update ()
	{
		if (Time.timeScale == 0)
		{
			scoreText.text = "Score: " + score;
			highScoreText.text = "High Score: " + highScores [Application.loadedLevel - 1];
			
			if (highScores [Application.loadedLevel - 1] > PlayerPrefsX.GetIntArray ("HighScore") [Application.loadedLevel - 1])
				PlayerPrefsX.SetIntArray ("HighScore", highScores);
		}
	}
}

A function from another class:

void Score ()
{
	if (count > ScoreManager.highScores [Application.loadedLevel - 1])
		ScoreManager.highScores [Application.loadedLevel - 1] = count;
	ScoreManager.score = count;
}

Do not use PlayerPrefsX. I have used it and it didn’t work as expected when using multiple arrays.
Instead build your own with PlayerPrefs. Here is what I have used in one of my projects. I have modified it for your purpose.

// Use this to set integer array
public static void SetHighScores (int[] highScores)
{
	PlayerPrefs.SetString ("HighScore", GetSerializedString(highScores));
}

// Use this to get integer array
public static int[] GetHighScores ()
{
	string[] data = PlayerPrefs.GetString ("HighScore", "0").Split ('|');
	int[] val = new int[data.Length];
	int score;
	for (int i = 0; i < val.Length; i++)
	{
		val _= int.TryParse(val*, out score) ? score : 0;*_

* }*
* return val;*
}

private static string GetSerializedString (int[] data)
{
* if (data.Length == 0) return string.Empty;*

* string result = data [0].ToString ();*
* for (int i = 1; i < data.Length; i++)*
* {*
_ result += (“|” + data*);
}
return result;
}*_