Updated the invoke method