fix replace tool bug