Small optimization on dialog, no need to call the wrapper twice in the same function call