add lock for server_impl