hasSwapped properly check

protect check for hasSwapped.