replace object with string matching