add a clearContent method that will also clean up attachments