remove memory leak on main, fix wrong inherance order on sortdialog.h