added the deadlock fix