fixed some bugs in the dialog. Still remains bugs with the historic