Fix bug with resourceSet.then