fixed unlinking attachments in core code