safety guard against undefined values