logic for correcting funny characterss