removing emergency flows as a last step