Added conditional compilation in order to support old versions of node.