changes for mock to work properly on different node versions