Deadlock fix