making gem thread safe
renaming client to connection