How to apply Conditional response