add null_term support