fix some bugs in gui tool