fix deadlock