fixed bug when child_pre_exit not defined