added array support for invoke method