add functions for swap out check