Fixed popup dialogs crashing