fix bug in toChildG