fixed the notice

fixed the undefined index notice with the help of stackoverflow. when looking for a value not in the array the issue came up.