made suffix tree thread-safe