Print error if index is not found in array