UNICARBKBNC-53: fixed if/else loop for references