add checking of handlers number to be invoked in release mode