change setDeleted access to public
add deleteAttachment logic
add test for deleting attachment