loop in loop in dialog