add if-then sample