synchronize since not threadsafe