fix newlines and characters