Deadlock fixed