trying to fix deadlock