Better way of detecting if the child is still running