fix hangs introduced by previous commit a6744b81777ab8247908350bd15cca49bedf5208