Fixed up dialog to be more efficient