handle deadlocks