avoid outputting undefined unnecessarily.