fix the error in parsing terms