updated to work with new format for invoke method