added #when command