centering dialogs improved