This is not the best locking scheme, but I believe it is correct.
Much better string handling in RPC requests