bug fixing for swap addresses