Adding missing flush function