Why is this synchronized section necessary?