fixed logic in union method