Fix bug for convert code to term