improved quotes escaping