Fix mismathcing type issue between directory node and node factory