fix joins algorithms