corrected mistake in union mathod