replace escapes before save