handling special cases, where multiple joins result in a mixup of aliases