add support for pin polarity