Added explicit synchronization. Verified it's needed.