Added utility code for Better Dialogs