remove extra null terminator