Fix Attributeerror on reordering if parent does not exist