changed set() to only set when it is defined.