fix potential field undefined issue