Removing empty flush which does not end stream