Trying to make dialog window working