fixed deadlocks caused by stacked synchronized's