added support for empty nodes