Chain correctly when a promise returns another promise