code patch from https://github.com/FLYBYME/node-transmission/issues/5