add when condition