bugfix: avoid repeatedly adding handlers