Thats okay if your solution works, although i see no different between your code and mine.
You only change variable %bet.closed to %nomorbet.