handle undefined values