adds if else when invoking method with parms