Fixing snippet to use Then() instead of And()