fix the joins