Fixed crash on lost connection