added flushes to functional tests