fix escaping when extracting strings