I have no clue why the original code doesn't work. But this change
seems to fix the issue.