Fixed bug when closing the app before it being initialized.