Changed delete routine in case of multiple attachements