fixed createNode function .