Added lock on getKey so two clients can't get the same key