This change indeed fixes the hang issue.