This does not change the logic of `updateDialog` function, but I think it is easier to understand without the return statement