fix python recursion return