Hopefully fixing deadlocks