Thread safety

Not sure why synchronized was removed...