Prevent delete if references in library