Actually make it threadsafe (but slow)