added check that parent has no attachments before adding any