dialogs work only when main activity is running