Fixed error with multiple chained then