Quick-fix for an undefined index - Thanks Aaron