yet another attempt at resolving deadlock issues