Added InvokeWithArgs method to ensure that certain function arguments are used