shouldn't the replace call be done in findAttachment now ?