Adding an isset check to make sure the array key exists to prevent "undefined index" notices