Change the precedence of flush command

The flush command should run after scenario. Because if it run before, the background of scenario is not working.