fix a first-time start crash bug