alphabetical ordering for elements in tree
fix problem with path equals to null