fix restart crash bug