This doesn't look thread-safe.