Fixed crash when no connection