fix for crash when exiting while building a base.