Fix error deadlock

@slimsag can you test please