repair bug in .then(x,y) where x or y are functions returning promises, resulting in silent recursive calls