added support for older node versions that do not support listenerCount