I believe it should be $active in place of # since # isn't going to have a value in a dialog event.