Created dialog box function