Instead of {Function,Global,Data}Symbol, use Defined{Function,Global,Data} because undefined symbol should never reach this function.