handles connection error