fix space encoding problem