deadlock fix