added stream end commands for better test stability