Flush when needed
Adapted to newest ssvs