fix conn not release when error