Remove long chains of .then() calls because they pass along values and that interferes with listContents().