implemented possibility to close currently opened dialog