Fix flush logic to remove unnecessary variable assignment

Change-Id: Ic5512018256e5307bbebcbd9d57d3c8d2a0db937