fixed read of digital outputs