Fixed a crash at startup