add method support for if