fix last null char