Added null parent check.