Fixed bug for crash at start.