Added the ability to override the next code from within the dialog