before changing segments