Fixed a crashbug during startup