fixed issue where bundler is not unloaded correctly due to hanging reference to @definition