fixed conditional logic in result dialog template