sanitizes a string for saving