fix Deadlock