fix check for undefined in iscomplete