preprocess text