logic for drag out