implemented editing and removing dialogs; fixed dialog's adding