check existence of a "replace" method in attr_escape instead of dict_to_attrs