fixed a nullpointerexception that were thrown when a parent doesnt have children, part B now finished