Fix the end with ime enabled