adjusted the positioning of the D3D flush command