fix bugs in dialog file and js files