fix the then chain to actually work