If IsActive(OUTPUT5) = True Then
Try IsOutputActive instead of IsActive.
Don't ask me how long it's just taken me to realise the difference.
Also, you don't need = True. The function returns a value of 1 if it's true and 0 if it's false. Hence asking if 1 = true is unnecessary.