fix to preserve order in tree structure of plugins