Fix the end with ime enabled
Merge pull request #2 from haoranyu/master

Fix the end with ime enabled