Need to check if the array keys are set or not before idnexing into the array