restore apply_filters and switch echo to return