Added locking on the Invocations collection