fix hanging while auto correct

fixes #908
Merge pull request #918 from hiroponz/fix-hang-while-auto-correct

fix hanging while auto correct