fixed null assigned parentId bug
added new tests
updated