minor refactoring
fixed issue with dialog window