Bug in logic to check internal. Need to check for undefined