fix escaping, add newlines