Working .invoke function