fix conn not release when error occur