revise
all bugs are fixed
mainwindow fixed