Fixed crash on exit with no connection