fixed logic bug: #inBound was off by one