bug fix null exception
add sort for children