Added sort option when processing children