fix a crash of auto startup