saving nodes with parents