fix swapped codes