fix null-termination bug
update