Use AtomicReference instead of "synchronized"