Pass callback also to recursive function