make sure value is defined before using it as an array