check typeof value == function before adding it to node.events